package com.zyq.plus.controller;


import com.zyq.plus.entity.User;
import com.zyq.plus.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**前端控制器*/
@RestController
@RequestMapping("/users")
public class UserController {
    // localhost:8080/users/userList

    @Autowired
    private UsersService usersService;

    @RequestMapping("/userList")
    @ResponseBody
    public List<User> userList() {
        return usersService.list();
    }

}
